pub const BLOCK_CHAIN_NAME: &str = "MiniChain";
pub const BLOCK_CHAIN_SYMBOL: &str = "MC";

pub const BLOCK_CHIAN_VERSION: u32 = 1;
pub const BLOCK_CHAIN_VERSION_STRING: &str = "1.0.0";

pub const PUBLIC_KEY_BYTES_LENGTH: usize = secp256k1::constants::PUBLIC_KEY_SIZE;
pub const PUBLIC_KEY_HASH_BYTES_LENGTH: usize = 20;
pub const PRIVATE_KEY_BYTES_LENGTH: usize = secp256k1::constants::SECRET_KEY_SIZE;
pub const COMPACT_SIGNATURE_LENGTH: usize = secp256k1::constants::COMPACT_SIGNATURE_SIZE;

pub const HASH256_BYTES_LENGTH: usize = 32;
pub const HASH160_BYTES_LENGTH: usize = 20;
pub const BLOCK_CHAIN_HASH_BYTES_LENGTH: usize = HASH256_BYTES_LENGTH;

pub const COIN: i64 = 100_000_000;
pub const CENT: i64 = 1_000_000;
pub const SUBSIDY: i64 = 50 * COIN;
pub const MAX_BLOCK_SIZE: usize = 1024 * 1024;

#[cfg(not(debug_assertions))]
pub const COINBASE_MATURITY: u32 = 100;

#[cfg(debug_assertions)]
pub const COINBASE_MATURITY: u32 = 0;

// generate one block every 10 minutes
//  Subsidy is cut in half every 4 years
//      subsidy >>= (self.best_height / 210000);
//  (4 * 365 * 24 * 60) / 10 = 210240
pub const SUBSIDY_ADJUSTMENT_INTERVAL: i64 = (4 * 365 * 24 * 60) / 10;

// #[cfg(not(debug_assertions))]
// pub const PROOF_OF_WORK_LIMIT_NBITS: u32 = 0x1c_ff_ffff;

// #[cfg(debug_assertions)]
pub const PROOF_OF_WORK_LIMIT_NBITS: u32 = 0x1f0f_ffff;

// #[rustfmt::skip]
// #[cfg(not(debug_assertions))]
// pub const PROOF_OF_WORK_LIMIT: [u8; 32] = [
//     0, 0, 0, 0,
//     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
//     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
//     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
//     0xff, 0xff, 0xff, 0xff,
// ];

// #[rustfmt::skip]
// #[cfg(debug_assertions)]
pub const PROOF_OF_WORK_LIMIT: [u8; 32] = [
    0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
];

// #[cfg(not(debug_assertions))]
// pub const PROOF_OF_WORK_LIMIT_VALID_BYTES_NUM: usize = 7;

// #[cfg(debug_assertions)]
pub const PROOF_OF_WORK_LIMIT_VALID_BYTES_NUM: usize = 4;

pub const HASH_256_BYTES_ZERO: crate::types::Hash256Bytes = [0; HASH256_BYTES_LENGTH];
pub const NULL_BLOCK_ID: crate::types::Hash256Bytes = HASH_256_BYTES_ZERO;
pub const NULL_TRANSACTION_ID: crate::types::Hash256Bytes = HASH_256_BYTES_ZERO;

pub const GENESIS_BLOCK_ID: &str =
    "0006a3920f07e5f80d340dbf214c52d83ce5b3802948307037d25b77d1fc4486";
// "0004c69b4ebac0037c015550c77de76e959c85ceb3481597d3de5ffac282539a";
pub const COINBASE_TX_ID_OF_GENESIS_BLOCK: &str =
    "428a4cd72d933389289863bbdd08491d0dd4eaa2f717c017439316a6ae35e56f";
// "9ddfd2ae61cbc5e74c0b1547c52a6363652233e33cd4d6527f7b65cbd7ef6c6f";
pub const GENESIS_ACCOUNT: &str =
    "029fb04b67ee96f862c622c4882d5940620ef7713d7903317a92d2cd3feb9ca106";
pub const GENESIS_ACCOUNT_HASH: &str = "9a3dd0eee41587a20d2a25be6a78d405e36a47aa";

// Alice and Bob account for test
pub const ALICE_PUBLICK_KEY: &str =
    "03721514a38bbe1cec0fab752beee25c62ac05228a66f230650b23ba30aafbb3e5";
pub const ALICE_PRIVATE_KEY: &str =
    "3654035c11efff36e9705543529d6509e744b93957e561dc69743add9f825488";
pub const ALICE_PUBLIC_KEY_HASH: &str = "c0b86b8c786e9dc809f1045fba1a099900721568";

pub const BOB_PUBLICK_KEY: &str =
    "02830cb6c689754721e43a07ff8fbf890f4e0bddcff3eb5a33945eeed59c006c4b";
pub const BOB_PRIVATE_KEY: &str =
    "4b3df0b356987e0c7aa551f40c2557e5676dd6df240abc7809ac3454018f8abe";
pub const BOB_PUBLIC_KEY_HASH: &str = "464ba1a1897ed851488dbce0cd0efaf440b8c8fa";
